﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharingCenter.Web.Shared
{
    public partial class TopmostMessage : System.Web.UI.UserControl
    {
        private string _text;
        private bool _showAfterPageUpdated = true;

        public string Text { get { return _text; } set { _text = value; Label1.Text = value; } }

        public bool ShowAfterPageUpdated { get { return _showAfterPageUpdated; } set { _showAfterPageUpdated = value; } }
         
        protected void Page_Load(object sender, EventArgs e)
        {
            if (_showAfterPageUpdated)
            {
                if(Classes.PageBase.PageUpdated)
                {
                    //this.Visible = true;
                    if (Session["TOP_MOST_MESSAGE"] != null)
                    {
                        Text = Session["TOP_MOST_MESSAGE"].ToString();
                        Session["TOP_MOST_MESSAGE"] = null;
                    }
                }
                else
                {
                     //this.Visible = false ;
                }
               
            }

            Classes.PageBase.PageUpdated = false;
        }
    }
}